import request from '@/utils/request'

// 获取公共列表
export function reqNoticeList(page: number) {
  return request({
    url: `/admin/notice/${page}`,
    method: 'get'
  })
}

// 新增公告
export function reqAddNotice(data: { title: string; content: string }) {
  return request({
    url: '/admin/notice',
    method: 'post',
    data
  })
}
// 删除公告
export function reqDeleteNotice(id: number) {
  return request({
    url: `/admin/notice/${id}/delete`,
    method: 'post'
  })
}
// 修改公告
export function reqUpdateNotice(id: number, data: { title: string; content: string }) {
  return request({
    url: `/admin/notice/${id}`,
    method: 'post',
    data
  })
}
